﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace GameBase
{
    public class GameEntity<T>
    {
        private bool _enable = true;
        private Vector2 _position = Vector2.Zero;
        protected Vector2 _size = Vector2.Zero;
        private List<T> _items = new List<T>();

        public virtual Vector2 Size
        {
            get { return _size; }
            set { _size = value; }
        }
        public virtual Vector2 Position
        {
            get { return _position; }
            set { _position = value; }
        }
        public virtual bool Enable
        {
            get { return _enable; }
            set { _enable = value; }
        }
        public virtual List<T> Items
        {
            get { return _items; }
            protected set { _items = value; }
        }
        public void Update(GameTime gameTime, Object extraData)
        {
            if (Enable)
                UpdateEntitys(gameTime, extraData);
        }
        protected virtual void UpdateEntitys(GameTime gameTime, Object extraData)
        {
        }
        public virtual void Add(T item)
        {
            Items.Add(item);
        }
        public virtual void Remove(T item)
        {
            Items.Remove(item);
        }
    }
}
